package com.exchange.controller.app.kyc;

import com.exchange.controller.BaseController;
import com.exchange.interceptor.AppUserTokenInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;
import com.jfinal.upload.UploadFile;
import java.util.List;

/**
 * 实名认证
 *
 * @author DENGLONG
 * @version 1.0
 * @create 2019-04-13 5:26 PM
 **/
@Before({KycValidator.class,AppUserTokenInterceptor.class})
public class KycController extends BaseController {
	
	@Inject
	KycService service;
	
    
    /**
     * c1 认证
     * 当前C1不进行审核,提交格式正缺就通过
     */
    public void authC1(String lastname, String firstname, String country, String idtype, String idno, String city) {
    	Ret ret = service.authC1(getAttr("user"), lastname, firstname, country, idtype, idno, city);
    	renderJson(ret);
    }


    /**
     * c2 认证,检测图片大小
     * getfile
     * form表单使用enctype="multipart/form-data"
     */
    public void authC2(List<UploadFile> ufs) {
    	Ret ret = service.authC2(getAttr("user"), ufs);
    	renderJson(ret);
	}

    /**
     * 用户KYC情况
     */
    public void getKycStep(){
    	Ret ret = service.getKycStep(getAttr("user"));
    	renderJson(ret);
    }
    
    
    
}
